import { formatterFileSize } from '@/utils/el-utils'

export const funcallLogTypeOptions = [
  {
    label: '工具',
    value: 'tool',
    raw:{
      listClass: 'primary'
    }
  },
  {
    label: '智能体',
    value: 'agent',
    raw:{
      listClass: 'danger'
    }
  },
]

export const baseEnumYesNoOptions = [
  {
    label: '是',
    value: 'YES',
    raw:{
      listClass: 'primary'
    }
  },
  {
    label: '否',
    value: 'NO',
    raw:{
      listClass: 'danger'
    }
  },
]

export const baseEnumEnabledDisabledOptions = [
  {
    label: '启用',
    value: 'enabled',
    raw:{
      listClass: 'primary'
    }
  },
  {
    label: '禁用',
    value: 'disabled',
    raw:{
      listClass: 'danger'
    }
  },
]

export const knowledgeStatusOptions = [
  {
    label: '草稿',
    value: 'draft',
    raw:{
      listClass: 'warning'
    }
  },
  {
    label: '完成',
    value: 'closed',
    raw:{
      listClass: 'primary'
    }
  },
  {
    label: '向量集合创建中',
    value: 'processing',
    raw:{
      listClass: 'primary'
    }
  },
]


export const knowledgeEnableSparseOptions = [
  {
    label: '启用稀疏向量',
    value: 1,
    raw:{
      listClass: 'success'
    }
  },
  {
    label: '禁用稀疏向量',
    value: 0,
    raw:{
      listClass: 'danger'
    }
  },
]



export const knowledgeDocumentStatusOptions = [
  {
    label: '待向量化',
    value: 'draft',
    raw:{
      listClass: 'success'
    }
  },
  {
    label: '向量化中',
    value: 'processing',
    raw: {
      listClass: 'primary'
    }
  },
  {
    label: '向量化失败',
    value: 'processing_failed',
    raw: {
      listClass: 'danger'
    }
  },
  {
    label: '已禁用',
    value: 'disabled',
    raw: {
      listClass: 'danger'
    }
  },
  {
    label: '已向量化',
    value: 'closed',
    raw: {
      listClass: 'primary'
    }
  }
]

export const knowledgeDimensionOptions = [
  {
    label: '384',
    value: 384,
    raw:{
      listClass: 'danger'
    }
  },
  {
    label: '768',
    value: 768,
    raw:{
      listClass: 'success'
    }
  },
  {
    label: '1024',
    value: 1024,
    raw:{
      listClass: 'danger'
    }
  },
  {
    label: '1536',
    value: 1536,
    raw:{
      listClass: 'danger'
    }
  },
]

export const chatMessageRoleEnum = {
  user: 'user',//用户
  assistant: 'assistant',//助手
  system: 'system',//系统
}

export const baseEnumConstants = {
  ENABLED: 'enabled',
  DISABLED: 'disabled',
  YES: 'YES',
  NO: 'NO',
}
export const aiModelTypeOptions=[
  {
    label: 'OpenAI',
    value: 'openai',
    raw:{
      listClass: 'primary'
    }
  },
  {
    label: 'OpenAI 流式',
    value: 'openai_stream',
    raw:{
      listClass: 'danger'
    }
  },
  {
    label: 'Llama Index',
    value: 'llama_index',
    raw:{
      listClass: 'success'
    }
  },
]

export const aiModelTypeEnum={
  OPENAI: 'openai',
  OPENAI_STREAM: 'openai_stream',
  LLAMA_INDEX: 'llama_index',
}

/**
 //main中使用
   Vue.prototype.dicts={}
   require('./utils/dicts').install(Vue.prototype.dicts)
 进行安装
 组件中直接使用 dicts.knowledgeDocumentStatusOptions
 */
export function install(root){
  root.knowledgeStatusOptions=knowledgeStatusOptions
  root.knowledgeEnableSparseOptions=knowledgeEnableSparseOptions
  root.knowledgeDocumentStatusOptions=knowledgeDocumentStatusOptions
  root.knowledgeDimensionOptions=knowledgeDimensionOptions
  root.chatMessageRoleEnum=chatMessageRoleEnum
  root.baseEnumEnabledDisabledOptions=baseEnumEnabledDisabledOptions
  root.baseEnumYesNoOptions=baseEnumYesNoOptions
  root.funcallLogTypeOptions=funcallLogTypeOptions
  root.aiModelTypeOptions=aiModelTypeOptions
  root.aiModelTypeEnum=aiModelTypeEnum


  root.baseEnumConstants=baseEnumConstants

}
